package ndquangr.intern.ringtonemaker;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class RingtoneMakerActivity extends Activity {
	/** Main window controls */
	private Button btn_browse;
	private Button btn_record;
	private Button btn_share;
	private Button btn_play;	
	private Context m_context;
		
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        m_context = this;
        
        // Get control instances
        getControlInstances();
       
        // Set action listeners
        addActionListeners();
    }


	private void addActionListeners() {
		// TODO Auto-generated method stub
		btn_browse.setOnClickListener(btn_browse_listener);
		btn_record.setOnClickListener(btn_record_listener);
		btn_play.setOnClickListener(btn_play_listener);
	}


	private void getControlInstances() {
		// TODO Auto-generated method stub
		btn_browse = (Button) findViewById(R.id.btn_main_browse);
		btn_record = (Button) findViewById(R.id.btn_main_record);
		btn_share = (Button) findViewById(R.id.btn_main_share);
		btn_play = (Button) findViewById(R.id.btn_main_player);
	}
		
	/** Action listeners */
	private OnClickListener btn_browse_listener = new OnClickListener() {
        @Override
		public void onClick(View v) {  
        	Intent myIntent = new Intent(m_context, BrowseActivity.class);			
			startActivity(myIntent);
        }
	};
	
	/** Action listeners */
	private OnClickListener btn_record_listener = new OnClickListener() {
        @Override
		public void onClick(View v) {  
        	Intent myIntent = new Intent(m_context, AudioRecordActivity.class);			
			startActivity(myIntent);
        }
	};
	
	private OnClickListener btn_play_listener = new OnClickListener() {
        @Override
		public void onClick(View v) {  
        	Intent myIntent = new Intent(m_context, MusicPlayerActivity.class);			
			startActivity(myIntent);
        }
	};
}